# NOT RUN {
# dummy inputs, independent variable
# integers from 0 to 19
inputs <- 0:19
# dummy targets/observed values, dependent variable
# a product of 2*times inputs minus 5 with some normal noise
targets <- -5 + inputs*1.2 + rnorm(20)
# linear regression model
model<-lm(targets~inputs)
# About the model
summary(model)
# model's predicted values against targets
predicted<-model$fitted.values
# using library ehaGoF for goodness of fit.
library(ehaGoF)
# Goodness of fit : mean error (ME)
gofME(targets, predicted)
# }
Run the code above in your browser using DataLab